Plots

Overview of all plotting functions

This page provides example calls and outputs for each of the plotting functions contained within agate. There are plotting functions that may be useful during survey planning, active piloting, and in post-processing and analysis, and the plots are grouped by those categories below.

Basic details for each plotting function are available within the standard MATLAB-type documentation in the header of each function and include a detailed description, info on input and output arguments, and examples. These details can be pulled up by typing doc function or help function within the MATLAB Command Window.

Initialization

To run any of the agate plotting functions, the toolbox must be initialized with a configuration file.

No configuration file yet? Go back to Get started - Create configuration files. At a minimum, the configuration file must include the top required portion, as well as the optional - plotting section.

% ensure agate is on the path

% initialize with specified configuration file, 'agate_config.cnf'
agate agate_config.cnf

% initialize with prompt to select configuration file
agate

Most of the plotting functions rely on a pp (piloting parameters) variable that is a large table with various outputs from the .nc and .log files compiled in one place. If this has already be created, it can be loaded directly. If not, use extractPilotingParams to build it.

% load existing pp table
load(fullfile(CONFIG.path.mission, 'flightStatus', ['diveTracking_' CONFIG.glider '.mat']))

% create new pp table
pp = extractPilotingParams(CONFIG, fullfile(CONFIG.path.mission, 'basestationFiles'), ...
fullfile(CONFIG.path.mission, 'flightStatus'), 0);
% zero as last argument creates it from scratch (does not load any previous tables)
save(fullfile(CONFIG.path.mission, 'flightStatus', ['diveTracking_' CONFIG.glider '.mat']), 'pp');

Back to top

Piloting plots

Some of the below piloting plots are also available withing the Seaglider Piloting Tools, but agate allows for more automated plotting (without the GUI) and tries to improve on some of those existing plots, either with better labels, more detail, or addition of acoustic inputs.

Humidity and pressure

plotHumidityPressure(CONFIG, pp)

Minimum voltage

Rev B gliders (e.g., SG639 - left side) will have two lines - one each for the ‘24V’ and ‘10V’ batteries (even if both are 15V), while Rev E gliders (e.g., SG679 - right side) will also have two lines, but the 10V line will primarily remain at 15V and only the 24V line will decrease over the mission.

plotMinVolt(CONFIG, pp)

Battery remaining and PAM free space

If the glider is using a PMAR acoustic system, the free space remaining on each SD card will plot with the remaining battery capacity.

The 30% battery line and 35 GB PMAR line are hard coded into the plot, but could be modified within the function. The ‘target mission duration’ line is defined by CONFIG.tmd, as set in the configuration file.

plotBattUseFreeSpace(CONFIG, pp)

Voltage use by device

If the glider is using a PMAR or WISPR acoustic system, power draw of the acoustic system will be included with measures of pitch, roll, and VBD.

plotVoltagePackUse(CONFIG, pp)

Voltage use by device, normalized by dive duration

If the glider is using a PMAR or WISPR acoustic system, power draw of the acoustic system will be included with measures of pitch, roll, and VBD.

plotVoltagePackUse_norm(CONFIG, pp)

Map

The map will include the waypoints and track from the targets file and will plot the surface positions of each dive (yellow dots), with red lines connecting surface positions, currents plotted as blue vector arrows, and the next target waypoint with a green circle.

Map extent (latitude and longitude limits), the location of the north arrow, and the location and scale of the scale bar are all set within the configuration file, with example values below. CONFIG.latLim and CONFIG.map.lonLim are required to make the map; the north arrow and scale bar are optional and if those settings do not exist in CONFIG they will not be included in the plot.

In this example, bathymetry is plotted, specified by CONFIG.map.bathyFile. That last argument can be left out to not plot bathymetry (which can be slow depending on the resolution of the selected bathymetry raster). If the last argument is set to 1, a prompt will appear to select the correct bathymetry file.

High resolution bathymetry TIFF files can be downloaded from NCEI. Depending on the needed resolution, the 60 arc second TIFF may be sufficient, and is a reasonable size for download and plotting, but is slow to load because it covers the whole globe. Alternatively, finer resolution (15-60 arc second resolution options) for the specific area of interest can be extracted using the ETOPO Grid Extract tool to download a TIFF that covers a smaller area, but in a smaller sized file for faster loading and plotting.

targetsFile = fullfile(CONFIG639.path.mission, 'targets');

% map set up configurations - all should be specified in configuration file 
CONFIG.map.latLim = [19.0 22.75];
CONFIG.map.lonLim = [-160.0 -154.25];
CONFIG.map.naLat = 22.15;
CONFIG.map.naLon = -154.5;
CONFIG.map.scalePos = [-0.04 0.34];
CONFIG.map.scaleMajor = [0:50:100];
CONFIG.map.scaleMinor = [0:12.5:25];

% plot with bathymetry - file specified 
plotGliderPath_etopo(CONFIG, pp, targetsFile, CONFIG.map.bathyFile);

% plot with bathymetry - prompt for bathy file
plotGliderPath_etopo(CONFIG, pp, targetsFile, 1);

% plot without bathymetry
plotGliderPath_etopo(CONFIG, pp, targetsFile);

Back to top